2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
12 /* This code is in the public domain.
13 ** Version: 1.1 Author: Walt Karas
16 /* The function in this file performs default actions if self-auditing
17 ** finds heap corruption. Don't rely on this code to handle the
18 ** case where HMM is being used to implement the malloc and free standard
19 ** library functions. Rewrite the function if necessary to avoid using
20 ** I/O and execution termination functions that call malloc or free.
21 ** In Unix, for example, you would replace the fputs calls with calls
22 ** to the write system call using file handle number 2.
24 #include "hmm_intrnl.h"
28 static int entered
= 0;
30 /* Print abort message, file and line. Terminate execution.
32 void hmm_dflt_abort(const char *file
, const char *line
)
34 /* Avoid use of printf(), which is more likely to use heap. */
38 /* The standard I/O functions called a heap function and caused
39 ** an indirect recursive call to this function. So we'll have
40 ** to just exit without printing a message. */
45 fputs("\n_abort - Heap corruption\n" "File: ", stderr
);
47 fputs(" Line: ", stderr
);
49 fputs("\n\n", stderr
);
50 fputs("hmm_dflt_abort: while(1)!!!\n", stderr
);