Merge "respect alignment in arm asm files"
[libvpx.git] / vpx_mem / memory_manager / hmm_dflt_abort.c
blobd92435cfa4672ec59706e811a31d2df857c46aeb
1 /*
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.
9 */
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"
25 #include <stdio.h>
26 #include <stdlib.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. */
36 if (entered)
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. */
41 while (1);
43 entered = 1;
45 fputs("\n_abort - Heap corruption\n" "File: ", stderr);
46 fputs(file, stderr);
47 fputs(" Line: ", stderr);
48 fputs(line, stderr);
49 fputs("\n\n", stderr);
50 fputs("hmm_dflt_abort: while(1)!!!\n", stderr);
51 fflush(stderr);
53 while (1);