]> git.proxmox.com Git - wasi-libc.git/blobdiff - libc-bottom-half/sources/sbrk.c
Use consistent style for wasi-libc C source files. (#131)
[wasi-libc.git] / libc-bottom-half / sources / sbrk.c
index 7803edfdaeb0a9616aca16dc54d451a2f127e81f..a26b75e9e3e52d0a96629d548cd23974eed518a0 100644 (file)
@@ -3,26 +3,26 @@
 #include <errno.h>
 #include <__macro_PAGESIZE.h>
 
-/* Bare-bones implementation of sbrk. */
+// Bare-bones implementation of sbrk.
 void *sbrk(intptr_t increment) {
-    /* sbrk(0) returns the current memory size. */
+    // sbrk(0) returns the current memory size.
     if (increment == 0) {
-        /* The wasm spec doesn't guarantee that memory.grow of 0 always succeeds. */
+        // The wasm spec doesn't guarantee that memory.grow of 0 always succeeds.
         return (void *)(__builtin_wasm_memory_size(0) * PAGESIZE);
     }
 
-    /* We only support page-size increments. */
+    // We only support page-size increments.
     if (increment % PAGESIZE != 0) {
         abort();
     }
 
-    /* WebAssembly doesn't support shrinking linear memory. */
+    // WebAssembly doesn't support shrinking linear memory.
     if (increment < 0) {
         abort();
     }
 
     uintptr_t old = __builtin_wasm_memory_grow(0, (uintptr_t)increment / PAGESIZE);
-   
+
     if (old == SIZE_MAX) {
         errno = ENOMEM;
         return (void *)-1;