News for hackers. Stuff that matters.
Re:You can now run WebAssembly on Cloudflare Workers by 1_player on Monday October 01, 2018 @03:27PM (#18115951)

  // Really trivial malloc() implementation. We just allocate bytes sequentially from the start of
  // the heap, and reset the whole heap to empty at the start of each request.
  extern byte __heap_base;   // Start of heap -- symbol provided by compiler.

  byte* heap = NULL;         // Current heap position.
  void* last_malloc = NULL;  // Last value returned by malloc(), for trivial optimizations.

  void* malloc(size_t n) {
    last_malloc = heap;
    heap += n;
    return last_malloc;
  }
Am I missing something? How can this work? __heap_base is never used, so first malloc returns a pointer to (void * )NULL;

Shouldn't it be:

  byte *heap = &__heap_base;
or something to that effect?

I haven't read the rest of the code, nor know how WebAssembly works, but I can't make sense of that snippet.

Re:You can now run WebAssembly on Cloudflare Workers by Arnavion on Monday October 01, 2018 @03:36PM (#18116046)
https://github.com/cloudflare/cloudflare-workers-wasm-demo/b...

    // init() is called from JS to allocate space for the image file.
    byte* init(size_t image_size) {
      // Reset the heap to empty. (See malloc() implementation in bootstrap.h.)
      heap = &__heap_base;
Re:You can now run WebAssembly on Cloudflare Workers by 1_player on Monday October 01, 2018 @03:38PM (#18116065)
Ah, I just had to look harder. Thanks
Re:You can now run WebAssembly on Cloudflare Workers by kentonv on Tuesday October 02, 2018 @10:09AM (#18121810)
TBH I did not expect people would actually be looking that closely. :)