Giter Club home page Giter Club logo

Comments (10)

mjansson avatar mjansson commented on June 2, 2024 1

I used to run my own small company called "Rampant Pixels" - but it doesn't exist anymore, so these days it could mean anything :)

from rpmalloc.

mjansson avatar mjansson commented on June 2, 2024

I would assume not many people have tried using it on a platform that falls back to that get_thread_id implementation. I'll see if I can sort out the implementation to do the right thing in this fallback case.

I would suggest you implement a correct get_thread_id in your port though, this fallback was never indented for actual use :)

from rpmalloc.

onelivesleft avatar onelivesleft commented on June 2, 2024

I would suggest you implement a correct get_thread_id in your port though, this fallback was never indented for actual use :)

Yeah, was an easy fix as there's a built-in u64 thread_index I could use.

from rpmalloc.

onelivesleft avatar onelivesleft commented on June 2, 2024

OT, but I don't want to make an issue because it's probably not a bug: why is this line a naked assert rather than rpmalloc_assert?

https://github.com/mjansson/rpmalloc/blob/develop/rpmalloc/rpmalloc.c#L1546

from rpmalloc.

mjansson avatar mjansson commented on June 2, 2024

I guess I simply forgot to update that line when introducing the error callback and custom assert macro :)

from rpmalloc.

mjansson avatar mjansson commented on June 2, 2024

Fixed now

from rpmalloc.

mjansson avatar mjansson commented on June 2, 2024

I decided to simply error out in compilation when there's no implementation for get_thread_id as there are assumptions in the implementation that the thread ID is static for the lifetime of the thread.

from rpmalloc.

onelivesleft avatar onelivesleft commented on June 2, 2024

Seems like the best solution. Can I ask on my way out the door: what does the rp_ stand for?

from rpmalloc.

onelivesleft avatar onelivesleft commented on June 2, 2024

Hey, spotted another thing that looks weird, but not sure is really a bug (so just posting here instead of raising):

heap->id = 1 + atomic_incr32(&_memory_heap_id);

atomic_incr returns the new value, so is the 1 + ... needed?

from rpmalloc.

mjansson avatar mjansson commented on June 2, 2024

No, it is not needed - I think it's a left over from the initial iterations where the atomic wrappers had the same semantics as atomic_fetch_add and returned the original value instead of matching InterlockedIncrement semantics returning the incremented value.

It's not really a bug, it only affects the starting heap ID value which will be set to 2 instead of 1 - the important bit is that it's non-zero.

from rpmalloc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.