Import Debian changes 20180207-1
[hcoop/debian/mlton.git] / runtime / gen / gen-sizes.c
1 /* Copyright (C) 2016-2017 Matthew Fluet.
2 * Copyright (C) 2007 Henry Cejtin, Matthew Fluet, Suresh
3 * Jagannathan, and Stephen Weeks.
4 *
5 * MLton is released under a BSD-style license.
6 * See the file MLton-LICENSE for details.
7 */
8
9 #define MLTON_GC_INTERNAL_TYPES
10 #include "platform.h"
11 struct GC_state gcState;
12
13 int main (__attribute__ ((unused)) int argc,
14 __attribute__ ((unused)) char* argv[]) {
15 FILE *sizesFd;
16
17 sizesFd = fopen_safe ("sizes", "w");
18
19 fprintf (sizesFd, "arrayMetaData = %"PRIuMAX"\n", (uintmax_t)GC_ARRAY_METADATA_SIZE);
20 fprintf (sizesFd, "cint = %"PRIuMAX"\n", (uintmax_t)sizeof(C_Int_t));
21 fprintf (sizesFd, "cpointer = %"PRIuMAX"\n", (uintmax_t)sizeof(C_Pointer_t));
22 fprintf (sizesFd, "cptrdiff = %"PRIuMAX"\n", (uintmax_t)sizeof(C_Ptrdiff_t));
23 fprintf (sizesFd, "csize = %"PRIuMAX"\n", (uintmax_t)sizeof(C_Size_t));
24 fprintf (sizesFd, "header = %"PRIuMAX"\n", (uintmax_t)sizeof(GC_header));
25 fprintf (sizesFd, "mplimb = %"PRIuMAX"\n", (uintmax_t)sizeof(C_MPLimb_t));
26 fprintf (sizesFd, "normalMetaData = %"PRIuMAX"\n", (uintmax_t)GC_NORMAL_METADATA_SIZE);
27 fprintf (sizesFd, "objptr = %"PRIuMAX"\n", (uintmax_t)sizeof(objptr));
28 fprintf (sizesFd, "seqIndex = %"PRIuMAX"\n", (uintmax_t)sizeof(GC_arrayLength));
29
30 fclose_safe(sizesFd);
31
32 return 0;
33 }