memory usage for const type

the problem is that using this function:

// this function will return the number of bytes currently free in RAM
// written by David A. Mellis
// based on code by Rob Faludi http://www.faludi.com

int availableMemory() {
  int size = 8192; // Use 2048 with ATmega328, 1024 with ATmega 168, 8192 con il 2560
  byte *buf;

  while ((buf = (byte *) malloc(--size)) == NULL)
    ;

  free(buf);

  return size;
}

declaring or not a const value the free memory space deoesn't change. I can't explain myself why...